package com.cloud.api.domain.sys;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cloud.core.entity.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

@TableName("t_system_user")
@Schema(name = "SystemUser", description = "用户")
@Data
public class SystemUser extends BaseEntity {
    private static final long serialVersionUID = 1L;
    @Schema(description = "主键", hidden = true)
    @TableId("user_id")
    private String userId;

    @Schema(description = "登陆名")
    @TableField("username")
    private String username;

    @Schema(description = "密码", hidden = true)
    @TableField("password")
    private String password;

    @Schema(description = "手机号码")
    @TableField("mobile")
    @NotNull(message = "手机号不能为空")
    private String mobile;

    @Schema(description = "昵称")
    @TableField("nick_name")
    private String nickName;

    @Schema(description = "角色")
    @TableField("role_id")
    @NotNull(message = "角色不能为空")
    private String roleId;

    @Schema(
            description = "启用/禁用"
    )
    @TableField("enable")
    @NotNull(message = "enable字段不能为空")
    private Integer enable;

    @Schema(description = "微信", hidden = true)
    @TableField("openid")
    private String openid;

    @Schema(description = "头像")
    @TableField("avatar")
    private String avatar;

    @Schema(description = "邮箱")
    @TableField("email")
    private String email;

    @Schema(description = "认证")
    @TableField("cert")
    private int cert;

    @Schema(description = "部门")
    @TableField("dept_id")
    private String deptId;

    @Schema(description = "部门")
    @TableField(exist = false)
    private String deptName;

    @Schema(description = "角色")
    @TableField(exist = false)
    private String roleName;
}
